MODULE_NAME	= myfwtest1

SRC := kernel_main.c netlink_help.c iprule.c conn.c hook.c nat.c

KDIR := /lib/modules/$(shell uname -r)/build

COMMON_INCLUDE := /mnt/hgfs/1  # 假设 common.h 在 include 文件夹内

EXTRA_CFLAGS := -I$(src)/include -I$(COMMON_INCLUDE)

$(MODULE_NAME)-objs = $(SRC:.c=.o)
obj-m := $(MODULE_NAME).o
PWD := $(shell pwd)

all:
	$(MAKE) -C $(KDIR) M=$(PWD) modules

install:
	insmod $(PWD)/$(MODULE_NAME).ko
	$(MAKE) clean

clean:
	$(MAKE) -C $(KDIR) M=$(PWD) clean
	rm -rf *.o *.ko *.mod.c *.mod *.order *.symvers .*.cmd .tmp_versions